using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;

namespace Whatsnexx {
    public class Migrations : DataMigrationImpl {

        public int Create() 
        {
        
            SchemaBuilder.CreateTable("WhatsnexxPartRecord",
                table => table
                    .ContentPartRecord()
                    .Column<string>("SubjectTypeId")
                    .Column<string>("SubjectCode")
                    .Column<string>("Environment")
                    .Column<string>("EventName")
                );

            SchemaBuilder.CreateTable("WhatsnexxSettingsPartRecord",
                table => table
                    .ContentPartRecord()
                    .Column<string>("TicketBusUrl")
                    .Column<string>("AccountId")
                    .Column<string>("UserName")
                    .Column<string>("Password")
                );

            ContentDefinitionManager.AlterPartDefinition("WhatsnexxPart", cfg => cfg.Attachable());

            return 1;
        }


    }
}